﻿using System;
using WinSource.Model.Helpers;

namespace WinSource.Model
{
    public class Video
    {
        #region Constructor

        public Video()
        {
        }

        public Video(string title, string url, DateTime publishDate)
        {
            Id = url.Replace("http://gdata.youtube.com/feeds/api/videos/", "");
            Title = title;
            PublishDate = publishDate;
        }

        #endregion

        #region Properties

        public string Id { get; set; }
        public string Title { get; set; }
        public DateTime PublishDate { get; set; }
        
        public string DateDifference
        {
            get
            {
                return DateHelper.GetDateDifferenceText(PublishDate);
            }
        }

        public string BigThumbnail { get { return string.Format("http://i.ytimg.com/vi/{0}/0.jpg", Id); }}
        public string SmallThumbnail { get { return string.Format("http://i.ytimg.com/vi/{0}/1.jpg", Id); } }
            
        #endregion
    }
}
